﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

public partial class listaOcorrencias : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

        if (Session["Usu_nome"] == null)
        {
            Response.Redirect("login.aspx");
            Response.End();
        }

        String tableOcorrencia = "<table id='table_consulta_usuario' cellpadding='0' cellspacing='1' class='grid' style='width: 700px;'><thead>" +
         "<tr>" +
             "<th><center>Código</center></th>" +
             "<th><center>Largadouro</center></th>" +
             "<th><center>Bairro</center></th>" +
             "<th><center>Ponto de Referência</center></th>" +
             "<th><center></center></th>" +
             "<th width='20px'><center></center></th>" +
             "</tr>" +
         "</thead>" +
         "<tbody>";

            RepositorioOcorrencia repOcorrencia = new RepositorioOcorrencia();
            String usu_login = Session["Usu_login"].ToString();
            tableOcorrencia += repOcorrencia.retornaOcorrenciasAbertas(usu_login);

            tableOcorrencia += "</tbody> </table>";
            tbOcorrencia.Text = tableOcorrencia;

        }
}
